package com.hiwhitley.easy.day07;

import com.hiwhitley.base.TreeNode;

/**
 * Created by hiwhitley on 2016/8/11.
 */
public class InvertTree {
    public TreeNode invertTree(TreeNode root) {
        if (root == null) {
            return null;
        }
        TreeNode right = invertTree(root.right);
        TreeNode left = invertTree(root.left);
        root.left = right;
        root.right = left;
        return root;
    }
}
